Binarizing secondary transform index

ABSTRACT

An example device for decoding video data includes a memory configured to store video data and one or more processors implemented in circuitry and configured to determine a maximum possible value for a secondary transform syntax element for a block of video data, entropy decode a value for the secondary transform syntax element of the block to form a binarized value representative of the secondary transform for the block, reverse binarize the value for the secondary transform syntax element using a common binarization scheme regardless of the maximum possible value to determine the secondary transform for the block, and inverse-transform transform coefficients of the block using the determined secondary transform.

This application is a continuation of U.S. application Ser. No.15/584,859 filed May 2, 2017, which claims the benefit of each of:

U.S. Provisional Application No. 62/331,290, filed May 3, 2016;

U.S. Provisional Application No. 62/332,425, filed May 5, 2016;

U.S. Provisional Application No. 62/337,310, filed May 16, 2016;

U.S. Provisional Application No. 62/340,949, filed May 24, 2016; and

U.S. Provisional Application No. 62/365,853, filed Jul. 22, 2016, theentire contents of each of which are hereby incorporated by reference.

TECHNICAL FIELD

This disclosure relates to video coding.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, tablet computers, e-book readers, digitalcameras, digital recording devices, digital media players, video gamingdevices, video game consoles, cellular or satellite radio telephones,so-called “smart phones,” video teleconferencing devices, videostreaming devices, and the like. Digital video devices implement videocoding techniques, such as those described in the standards defined byMPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, Advanced VideoCoding (AVC), the High Efficiency Video Coding (HEVC) standard, andextensions of such standards. The video devices may transmit, receive,encode, decode, and/or store digital video information more efficientlyby implementing such video coding techniques.

Video coding techniques include spatial (intra-picture) predictionand/or temporal (inter-picture) prediction to reduce or removeredundancy inherent in video sequences. For block-based video coding, avideo slice (e.g., a video picture or a portion of a video picture) maybe partitioned into video blocks, which may also be referred to ascoding tree units (CTUs), coding units (CUs) and/or coding nodes. Videoblocks in an intra-coded (I) slice of a picture are encoded usingspatial prediction with respect to reference samples in neighboringblocks in the same picture. Video blocks in an inter-coded (P or B)slice of a picture may use spatial prediction with respect to referencesamples in neighboring blocks in the same picture or temporal predictionwith respect to reference samples in other reference pictures. Picturesmay be referred to as frames, and reference pictures may be referred toa reference frames.

Spatial or temporal prediction results in a predictive block for a blockto be coded. Residual data represents pixel differences between theoriginal block to be coded and the predictive block. An inter-codedblock is encoded according to a motion vector that points to a block ofreference samples forming the predictive block, and the residual dataindicating the difference between the coded block and the predictiveblock. An intra-coded block is encoded according to an intra-coding modeand the residual data. For further compression, the residual data may betransformed from the pixel domain to a transform domain, resulting inresidual transform coefficients, which then may be quantized. Thequantized transform coefficients, initially arranged in atwo-dimensional array, may be scanned in order to produce aone-dimensional vector of transform coefficients, and entropy coding maybe applied to achieve even more compression.

SUMMARY

In general, this disclosure describes techniques related to entropycoding (encoding or decoding) secondary transform syntax elements of ablock of video data. The secondary transform syntax elements mayinclude, for example, non-separable secondary transform (NSST) syntaxelements, rotational transform syntax elements, or the like. In general,entropy coding of these syntax elements may include binarization orreverse binarization. The binarization or reverse binarization schememay be unified such that the same binarization or reverse binarizationscheme is applied, regardless of a maximum possible value for thesecondary transform syntax elements. The techniques of this disclosuremay further include coding (encoding or decoding) signaling unit syntaxelements, where the signaling unit may include two or more neighboringblocks. Signaling unit syntax elements may precede each of the blocks,or be placed immediately before (in coding order) a block to which thesignaling unit syntax elements apply.

In one example, a method of decoding video data includes determining amaximum possible value for a secondary transform syntax element for ablock of video data, entropy decoding a value for the secondarytransform syntax element of the block to form a binarized valuerepresentative of the secondary transform for the block, reversebinarizing the value for the secondary transform syntax element using acommon reverse binarization scheme regardless of the maximum possiblevalue to determine the secondary transform for the block, and inversetransforming transform coefficients of the block using the determinedsecondary transform.

In another example, a device for decoding video data includes a memoryconfigured to store video data and one or more processors implemented incircuitry and configured to determine a maximum possible value for asecondary transform syntax element for a block of video data, entropydecode a value for the secondary transform syntax element of the blockto form a binarized value representative of the secondary transform forthe block, reverse binarize the value for the secondary transform syntaxelement using a common binarization scheme regardless of the maximumpossible value to determine the secondary transform for the block, andinverse-transform transform coefficients of the block using thedetermined secondary transform.

In another example, a device for decoding video data includes means fordetermining a maximum possible value for a secondary transform syntaxelement for a block of video data, means for entropy decoding a valuefor the secondary transform syntax element of the block to form abinarized value representative of the secondary transform for the block,means for reverse binarizing the value for the secondary transformsyntax element using a common reverse binarization scheme regardless ofthe maximum possible value to determine the secondary transform for theblock, and means for inverse transforming transform coefficients of theblock using the determined secondary transform.

In another example, a computer-readable storage medium (e.g., anon-transitory computer-readable storage medium) has stored thereoninstructions that, when executed, cause one or more processors todetermine a maximum possible value for a secondary transform syntaxelement for a block of video data, entropy decode a value for thesecondary transform syntax element of the block to form a binarizedvalue representative of the secondary transform for the block, reversebinarize the value for the secondary transform syntax element using acommon reverse binarization scheme regardless of the maximum possiblevalue to determine the secondary transform for the block, andinverse-transform transform coefficients of the block using thedetermined secondary transform.

In another example, a method of encoding video data includestransforming intermediate transform coefficients of a block of videodata using a secondary transform, determining a maximum possible valuefor a secondary transform syntax element for the block, a value of thesecondary transform syntax element representing the secondary transform,binarizing the value for the secondary transform syntax element using acommon binarization scheme regardless of the maximum possible value, andentropy encoding the binarized value for the secondary transform syntaxelement of the block to form a binarized value representative of thesecondary transform for the block.

In another example, a device for encoding video data includes a memoryconfigured to store video data and one or more processors implemented incircuitry and configured to, transform intermediate transformcoefficients of a block of video data using a secondary transform,determine a maximum possible value for a secondary transform syntaxelement for the block, a value of the secondary transform syntax elementrepresenting the secondary transform, binarize the value for thesecondary transform syntax element using a common binarization schemeregardless of the maximum possible value, and entropy encode thebinarized value for the secondary transform syntax element of the blockto form a binarized value representative of the secondary transform forthe block.

The details of one or more examples are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages will be apparent from the description and drawings, and fromthe claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example video encoding anddecoding system that may utilize techniques for binarizing a secondarytransform index.

FIG. 2 is a block diagram illustrating an example of a video encoderthat may implement techniques for binarizing a secondary transformindex.

FIG. 3 is a block diagram of an example entropy encoding unit that maybe configured to perform CABAC in accordance with the techniques of thisdisclosure.

FIG. 4 is a block diagram illustrating an example of a video decoderthat may implement techniques for binarizing a secondary transformindex.

FIG. 5 is a block diagram of an example entropy encoding unit that maybe configured to perform CABAC in accordance with the techniques of thisdisclosure.

FIG. 6 is a flowchart illustrating an example method of encoding videodata in accordance with the techniques of this disclosure.

FIG. 7 is a flowchart illustrating an example of a method of decodingvideo data in accordance with the techniques of this disclosure.

DETAILED DESCRIPTION

Video coding standards include ITU-T H.261, ISO/IEC MPEG-1 Visual, ITU-TH.262 or ISO/IEC MPEG-2 Visual, ITU-T H.263, ISO/IEC MPEG-4 Visual,ITU-T H.264 (also known as ISO/IEC MPEG-4 AVC (Advanced Video Coding)),ITU-T H.265 (also knows and HEVC or “High Efficiency Video Coding”),including extensions such as Scalable Video Coding (SVC), Multi-viewVideo Coding (MVC) and Screen content coding (SCC). The techniques ofthis disclosure may be applied in these or future video codingstandards, such as Joint Video Exploration Team (JVET) test model (whichmay also be referred to as the Joint Exploration Model—JEM), which isundergoing development activity beyond HEVC. Video coding standards alsoinclude proprietary video codecs, such as Google VP8, VP9, VP10, andvideo codecs developed by other organizations, for example, Alliance forOpen Media.

In JVET test model, there is an intra prediction method called positiondependent intra prediction combination (PDPC). The JVET test model alsoincludes a non-separable secondary transform (NSST) tool. Both the PDPCand NSST tools use syntax elements (e.g., indexes) to indicate whetherthe corresponding tool is applied and which variation is used. Forexample, index 0 may mean that the tool is not used.

A maximum number of NSST indices of a block of video data may depend onthe intra prediction modes or partition size of the block. In oneexample, if the intra prediction mode is PLANAR or DC and partition sizeis 2N×2N, the maximum number of NSST indices is 3, otherwise the maximumnumber of NSST indices is 4. Under the JVET test model, two types ofbinarization are used to represent the NSST index. In the JVET testmodel, if the maximum value is 3, truncated unary binarization is used,otherwise fixed binary binarization is applied. In the JVET test model,NSST is not applied and NSST index is not signaled if the PDPC index isnot equal to 0.

This disclosure describes a variety of techniques that may be applied,alone or in any combination, to improve, e.g., coding of NSST syntaxelement(s), such as NSST indexes and/or NSST flags. For example, thesetechniques may improve the functioning of the video encoder/videodecoder, and thereby improve bitstream efficiency, in that thesetechniques may reduce the bitrate of the bitstream, relative to thecurrent JVET test model.

FIG. 1 is a block diagram illustrating an example video encoding anddecoding system 10 that may utilize techniques for binarizing asecondary transform index. As shown in FIG. 1, system 10 includes asource device 12 that provides encoded video data to be decoded at alater time by a destination device 14. In particular, source device 12provides the video data to destination device 14 via a computer-readablemedium 16. Source device 12 and destination device 14 may comprise anyof a wide range of devices, including desktop computers, notebook (i.e.,laptop) computers, tablet computers, set-top boxes, telephone handsetssuch as so-called “smart” phones, so-called “smart” pads, televisions,cameras, display devices, digital media players, video gaming consoles,video streaming device, or the like. In some cases, source device 12 anddestination device 14 may be equipped for wireless communication.

Destination device 14 may receive the encoded video data to be decodedvia computer-readable medium 16. Computer-readable medium 16 maycomprise any type of medium or device capable of moving the encodedvideo data from source device 12 to destination device 14. In oneexample, computer-readable medium 16 may comprise a communication mediumto enable source device 12 to transmit encoded video data directly todestination device 14 in real-time. The encoded video data may bemodulated according to a communication standard, such as a wirelesscommunication protocol, and transmitted to destination device 14. Thecommunication medium may comprise any wireless or wired communicationmedium, such as a radio frequency (RF) spectrum or one or more physicaltransmission lines. The communication medium may form part of apacket-based network, such as a local area network, a wide-area network,or a global network such as the Internet. The communication medium mayinclude routers, switches, base stations, or any other equipment thatmay be useful to facilitate communication from source device 12 todestination device 14.

In some examples, encoded data may be output from output interface 22 toa storage device. Similarly, encoded data may be accessed from thestorage device by input interface. The storage device may include any ofa variety of distributed or locally accessed data storage media such asa hard drive, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile ornon-volatile memory, or any other suitable digital storage media forstoring encoded video data. In a further example, the storage device maycorrespond to a file server or another intermediate storage device thatmay store the encoded video generated by source device 12. Destinationdevice 14 may access stored video data from the storage device viastreaming or download. The file server may be any type of server capableof storing encoded video data and transmitting that encoded video datato the destination device 14. Example file servers include a web server(e.g., for a website), an FTP server, network attached storage (NAS)devices, or a local disk drive. Destination device 14 may access theencoded video data through any standard data connection, including anInternet connection. This may include a wireless channel (e.g., a Wi-Ficonnection), a wired connection (e.g., DSL, cable modem, etc.), or acombination of both that is suitable for accessing encoded video datastored on a file server. The transmission of encoded video data from thestorage device may be a streaming transmission, a download transmission,or a combination thereof.

The techniques of this disclosure are not necessarily limited towireless applications or settings. The techniques may be applied tovideo coding in support of any of a variety of multimedia applications,such as over-the-air television broadcasts, cable televisiontransmissions, satellite television transmissions, Internet streamingvideo transmissions, such as dynamic adaptive streaming over HTTP(DASH), digital video that is encoded onto a data storage medium,decoding of digital video stored on a data storage medium, or otherapplications. In some examples, system 10 may be configured to supportone-way or two-way video transmission to support applications such asvideo streaming, video playback, video broadcasting, and/or videotelephony.

In the example of FIG. 1, source device 12 includes video source 18,video encoder 20, and output interface 22. Destination device 14includes input interface 28, video decoder 30, and display device 32. Inaccordance with this disclosure, video encoder 20 of source device 12may be configured to apply the techniques for binarizing a secondarytransform index. In other examples, a source device and a destinationdevice may include other components or arrangements. For example, sourcedevice 12 may receive video data from an external video source 18, suchas an external camera. Likewise, destination device 14 may interfacewith an external display device, rather than including an integrateddisplay device.

The illustrated system 10 of FIG. 1 is merely one example. Techniquesfor binarizing a secondary transform index may be performed by anydigital video encoding and/or decoding device. Although generally thetechniques of this disclosure are performed by a video encoding device,the techniques may also be performed by a video encoder/decoder,typically referred to as a “CODEC.” Moreover, the techniques of thisdisclosure may also be performed by a video preprocessor. Source device12 and destination device 14 are merely examples of such coding devicesin which source device 12 generates coded video data for transmission todestination device 14. In some examples, devices 12, 14 may operate in asubstantially symmetrical manner such that each of devices 12, 14include video encoding and decoding components. Hence, system 10 maysupport one-way or two-way video transmission between video devices 12,14, e.g., for video streaming, video playback, video broadcasting, orvideo telephony.

Video source 18 of source device 12 may include a video capture device,such as a video camera, a video archive containing previously capturedvideo, and/or a video feed interface to receive video from a videocontent provider. As a further alternative, video source 18 may generatecomputer graphics-based data as the source video, or a combination oflive video, archived video, and computer-generated video. In some cases,if video source 18 is a video camera, source device 12 and destinationdevice 14 may form so-called camera phones or video phones. As mentionedabove, however, the techniques described in this disclosure may beapplicable to video coding in general, and may be applied to wirelessand/or wired applications. In each case, the captured, pre-captured, orcomputer-generated video may be encoded by video encoder 20. The encodedvideo information may then be output by output interface 22 onto acomputer-readable medium 16.

Computer-readable medium 16 may include transient media, such as awireless broadcast or wired network transmission, or storage media (thatis, non-transitory storage media), such as a hard disk, flash drive,compact disc, digital video disc, Blu-ray disc, or othercomputer-readable media. In some examples, a network server (not shown)may receive encoded video data from source device 12 and provide theencoded video data to destination device 14, e.g., via networktransmission. Similarly, a computing device of a medium productionfacility, such as a disc stamping facility, may receive encoded videodata from source device 12 and produce a disc containing the encodedvideo data. Therefore, computer-readable medium 16 may be understood toinclude one or more computer-readable media of various forms, in variousexamples.

Input interface 28 of destination device 14 receives information fromcomputer-readable medium 16. The information of computer-readable medium16 may include syntax information defined by video encoder 20, which isalso used by video decoder 30, that includes syntax elements thatdescribe characteristics and/or processing of blocks and other codedunits. Display device 32 displays the decoded video data to a user, andmay comprise any of a variety of display devices such as a cathode raytube (CRT), a liquid crystal display (LCD), a plasma display, an organiclight emitting diode (OLED) display, or another type of display device.

Video encoder 20 and video decoder 30 may operate according to a videocoding standard, such as the High Efficiency Video Coding (HEVC)standard, also referred to as ITU-T H.265. Alternatively, video encoder20 and video decoder 30 may operate according to other proprietary orindustry standards, such as the ITU-T H.264 standard, alternativelyreferred to as MPEG-4, Part 10, Advanced Video Coding (AVC), orextensions of such standards. The techniques of this disclosure,however, are not limited to any particular coding standard. Otherexamples of video coding standards include MPEG-2 and ITU-T H.263.Although not shown in FIG. 1, in some aspects, video encoder 20 andvideo decoder 30 may each be integrated with an audio encoder anddecoder, and may include appropriate MUX-DEMUX units, or other hardwareand software, to handle encoding of both audio and video in a commondata stream or separate data streams. If applicable, MUX-DEMUX units mayconform to the ITU H.223 multiplexer protocol, or other protocols suchas the user datagram protocol (UDP).

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder circuitry, such as one or moremicroprocessors, digital signal processors (DSPs), application specificintegrated circuits (ASICs), field programmable gate arrays (FPGAs),discrete logic, software, hardware, firmware or any combinationsthereof. When the techniques are implemented partially in software, adevice may store instructions for the software in a suitable,non-transitory computer-readable medium and execute the instructions inhardware using one or more processors to perform the techniques of thisdisclosure. Each of video encoder 20 and video decoder 30 may beincluded in one or more encoders or decoders, either of which may beintegrated as part of a combined encoder/decoder (CODEC) in a respectivedevice.

In general, according to ITU-T H.265, a video picture may be dividedinto a sequence of coding tree units (CTUs) (or largest coding units(LCUs)) that may include both luma and chroma samples. Alternatively,CTUs may include monochrome data (i.e., only luma samples). Syntax datawithin a bitstream may define a size for the CTU, which is a largestcoding unit in terms of the number of pixels. A slice includes a numberof consecutive CTUs in coding order. A video picture may be partitionedinto one or more slices. Each CTU may be split into coding units (CUs)according to a quadtree. In general, a quadtree data structure includesone node per CU, with a root node corresponding to the CTU. If a CU issplit into four sub-CUs, the node corresponding to the CU includes fourleaf nodes, each of which corresponds to one of the sub-CUs.

Each node of the quadtree data structure may provide syntax data for thecorresponding CU. For example, a node in the quadtree may include asplit flag, indicating whether the CU corresponding to the node is splitinto sub-CUs. Syntax elements for a CU may be defined recursively, andmay depend on whether the CU is split into sub-CUs. If a CU is not splitfurther, it is referred as a leaf-CU. In this disclosure, four sub-CUsof a leaf-CU will also be referred to as leaf-CUs even if there is noexplicit splitting of the original leaf-CU. For example, if a CU at16×16 size is not split further, the four 8×8 sub-CUs will also bereferred to as leaf-CUs although the 16×16 CU was never split.

A CU has a similar purpose as a macroblock of the H.264 standard, exceptthat a CU does not have a size distinction. For example, a CTU may besplit into four child nodes (also referred to as sub-CUs), and eachchild node may in turn be a parent node and be split into another fourchild nodes. A final, unsplit child node, referred to as a leaf node ofthe quadtree, comprises a coding node, also referred to as a leaf-CU.Syntax data associated with a coded bitstream may define a maximumnumber of times a CTU may be split, referred to as a maximum CU depth,and may also define a minimum size of the coding nodes. Accordingly, abitstream may also define a smallest coding unit (SCU). This disclosureuses the term “block” to refer to any of a CU, prediction unit (PU), ortransform unit (TU), in the context of HEVC, or similar data structuresin the context of other standards (e.g., macroblocks and sub-blocksthereof in H.264/AVC).

A CU includes a coding node and prediction units (PUs) and transformunits (TUs) associated with the coding node. A size of the CUcorresponds to a size of the coding node and is generally square inshape. The size of the CU may range from 8×8 pixels up to the size ofthe CTU with a maximum size, e.g., 64×64 pixels or greater. Each CU maycontain one or more PUs and one or more TUs. Syntax data associated witha CU may describe, for example, partitioning of the CU into one or morePUs. Partitioning modes may differ between whether the CU is skip ordirect mode encoded, intra-prediction mode encoded, or inter-predictionmode encoded. PUs may be partitioned to be non-square in shape. Syntaxdata associated with a CU may also describe, for example, partitioningof the CU into one or more TUs according to a quadtree. A TU can besquare or non-square (e.g., rectangular) in shape.

The HEVC standard allows for transformations according to TUs, which maybe different for different CUs. The TUs are typically sized based on thesize of PUs within a given CU defined for a partitioned CTU, althoughthis may not always be the case. The TUs are typically the same size orsmaller than the PUs. In some examples, residual samples correspondingto a CU may be subdivided into smaller units using a quadtree structureknown as “residual quad tree” (RQT). The leaf nodes of the RQT may bereferred to as transform units (TUs). Pixel difference values associatedwith the TUs may be transformed to produce transform coefficients, whichmay be quantized.

A leaf-CU may include one or more prediction units (PUs). In general, aPU represents a spatial area corresponding to all or a portion of thecorresponding CU, and may include data for retrieving and/or generatinga reference sample for the PU. Moreover, a PU includes data related toprediction. For example, when the PU is intra-mode encoded, data for thePU may be included in a residual quadtree (RQT), which may include datadescribing an intra-prediction mode for a TU corresponding to the PU.The RQT may also be referred to as a transform tree. In some examples,the intra-prediction mode may be signaled in the leaf-CU syntax, insteadof the RQT. As another example, when the PU is inter-mode encoded, thePU may include data defining motion information, such as one or moremotion vectors, for the PU. The data defining the motion vector for a PUmay describe, for example, a horizontal component of the motion vector,a vertical component of the motion vector, a resolution for the motionvector (e.g., one-quarter pixel precision or one-eighth pixelprecision), a reference picture to which the motion vector points,and/or a reference picture list (e.g., List 0, List 1, or List C) forthe motion vector.

A leaf-CU having one or more PUs may also include one or more transformunits (TUs). The transform units may be specified using an RQT (alsoreferred to as a TU quadtree structure), as discussed above. Forexample, a split flag may indicate whether a leaf-CU is split into fourtransform units. Then, each transform unit may be split further intofurther sub-TUs. When a TU is not split further, it may be referred toas a leaf-TU. Generally, for intra coding, all the leaf-TUs belonging toa leaf-CU share the same intra prediction mode. That is, the sameintra-prediction mode is generally applied to calculate predicted valuesfor all TUs of a leaf-CU. For intra coding, a video encoder maycalculate a residual value for each leaf-TU using the intra predictionmode, as a difference between the portion of the CU corresponding to theTU and the original block. A TU is not necessarily limited to the sizeof a PU. Thus, TUs may be larger or smaller than a PU. For intra coding,a PU may be collocated with a corresponding leaf-TU for the same CU. Insome examples, the maximum size of a leaf-TU may correspond to the sizeof the corresponding leaf-CU.

Moreover, TUs of leaf-CUs may also be associated with respectivequadtree data structures, referred to as residual quadtrees (RQTs). Thatis, a leaf-CU may include a quadtree indicating how the leaf-CU ispartitioned into TUs. The root node of a TU quadtree generallycorresponds to a leaf-CU, while the root node of a CU quadtree generallycorresponds to a CTU (or LCU). TUs of the RQT that are not split arereferred to as leaf-TUs. In general, this disclosure uses the terms CUand TU to refer to leaf-CU and leaf-TU, respectively, unless notedotherwise.

A video sequence typically includes a series of video frames orpictures, starting with a random access point (RAP) picture. A videosequence may include syntax data in a sequence parameter set (SPS) thatcharacteristics of the video sequence. Each slice of a picture mayinclude slice syntax data that describes an encoding mode for therespective slice. Video encoder 20 typically operates on video blockswithin individual video slices in order to encode the video data. Avideo block may correspond to a coding node within a CU. The videoblocks may have fixed or varying sizes, and may differ in size accordingto a specified coding standard.

As an example, prediction may be performed for PUs of various sizes.Assuming that the size of a particular CU is 2N×2N, intra-prediction maybe performed on PU sizes of 2N×2N or N×N, and inter-prediction may beperformed on symmetric PU sizes of 2N×2N, 2N×N, N×2N, or N×N. Asymmetricpartitioning for inter-prediction may also be performed for PU sizes of2N×nU, 2N×nD, nL×2N, and nR×2N. In asymmetric partitioning, onedirection of a CU is not partitioned, while the other direction ispartitioned into 25% and 75%. The portion of the CU corresponding to the25% partition is indicated by an “n” followed by an indication of “Up”,“Down,” “Left,” or “Right.” Thus, for example, “2N×nU” refers to a 2N×2NCU that is partitioned horizontally with a 2N×0.5N PU on top and a2N×1.5N PU on bottom.

In this disclosure, “N×N” and “N by N” may be used interchangeably torefer to the pixel dimensions of a video block in terms of vertical andhorizontal dimensions, e.g., 16×16 pixels or 16 by 16 pixels. Ingeneral, a 16×16 block will have 16 pixels in a vertical direction(y=16) and 16 pixels in a horizontal direction (x=16). Likewise, an N×Nblock generally has N pixels in a vertical direction and N pixels in ahorizontal direction, where N represents a nonnegative integer value.The pixels in a block may be arranged in rows and columns. Moreover,blocks need not necessarily have the same number of pixels in thehorizontal direction as in the vertical direction. For example, blocksmay comprise N×M pixels, where M is not necessarily equal to N.

Following intra-predictive or inter-predictive coding using the PUs of aCU, video encoder 20 may calculate residual data for the TUs of the CU.The PUs may comprise syntax data describing a method or mode ofgenerating predictive pixel data in the spatial domain (also referred toas the pixel domain) and the TUs may comprise coefficients in thetransform domain following application of a transform, e.g., a discretecosine transform (DCT), an integer transform, a wavelet transform, or aconceptually similar transform to residual video data. The residual datamay correspond to pixel differences between pixels of the unencodedpicture and prediction values corresponding to the PUs. Video encoder 20may form the TUs to include quantized transform coefficientsrepresentative of the residual data for the CU. That is, video encoder20 may calculate the residual data (in the form of a residual block),transform the residual block to produce a block of transformcoefficients, and then quantize the transform coefficients to formquantized transform coefficients. Video encoder 20 may form a TUincluding the quantized transform coefficients, as well as other syntaxinformation (e.g., splitting information for the TU).

As noted above, following any transforms to produce transformcoefficients, video encoder 20 may perform quantization of the transformcoefficients. Quantization generally refers to a process in whichtransform coefficients are quantized to possibly reduce the amount ofdata used to represent the coefficients, providing further compression.The quantization process may reduce the bit depth associated with someor all of the coefficients. For example, an n-bit value may be roundeddown to an m-bit value during quantization, where n is greater than m.

Following quantization, the video encoder may scan the transformcoefficients, producing a one-dimensional vector from thetwo-dimensional matrix including the quantized transform coefficients.The scan may be designed to place higher energy (and therefore lowerfrequency) coefficients at the front of the array and to place lowerenergy (and therefore higher frequency) coefficients at the back of thearray. In some examples, video encoder 20 may utilize a predefined scanorder to scan the quantized transform coefficients to produce aserialized vector that can be entropy encoded. In other examples, videoencoder 20 may perform an adaptive scan. After scanning the quantizedtransform coefficients to form a one-dimensional vector, video encoder20 may entropy encode the one-dimensional vector, e.g., according tocontext-adaptive variable length coding (CAVLC), context-adaptive binaryarithmetic coding (CABAC), syntax-based context-adaptive binaryarithmetic coding (SBAC), Probability Interval Partitioning Entropy(PIPE) coding or another entropy encoding methodology. Video encoder 20may also entropy encode syntax elements associated with the encodedvideo data for use by video decoder 30 in decoding the video data.

To perform CABAC, video encoder 20 may assign a context within a contextmodel to a symbol to be transmitted. The context may relate to, forexample, whether neighboring values of the symbol are non-zero or not.To perform CAVLC, video encoder 20 may select a variable length code fora symbol to be transmitted. Codewords in VLC may be constructed suchthat relatively shorter codes correspond to more probable symbols, whilelonger codes correspond to less probable symbols. In this way, the useof VLC may achieve a bit savings over, for example, using equal-lengthcodewords for each symbol to be transmitted. The probabilitydetermination may be based on a context assigned to the symbol.

In general, video decoder 30 performs a substantially similar, albeitreciprocal, process to that performed by video encoder 20 to decodeencoded data. For example, video decoder 30 inverse quantizes andinverse transforms coefficients of a received TU to reproduce a residualblock. Video decoder 30 uses a signaled prediction mode (intra- orinter-prediction) to form a predicted block. Then video decoder 30combines the predicted block and the residual block (on a pixel-by-pixelbasis) to reproduce the original block. Additional processing may beperformed, such as performing a deblocking process to reduce visualartifacts along block boundaries. Furthermore, video decoder 30 maydecode syntax elements using CABAC in a manner substantially similar to,albeit reciprocal to, the CABAC encoding process of video encoder 20.

In accordance with the techniques of this disclosure, a video coder,such as video encoder 20 or video decoder 30, may unify binarization ofan NSST syntax element. For example, the video coder may be configuredto use only one binarization (e.g., truncated or truncated unarybinarization). A maximum value for an NSST syntax element may be defined(and therefore determined by the video coder) according to an intramode, and optionally block size condition(s), for a block for which theNSST syntax element is coded. For example, the video coder may applytruncated unary binarization for an NSST index, where the maximum valueis equal to 3 if the current intra mode is non-angular (e.g., PLANAR orDC, or optionally LM mode for chroma components), otherwise max value isequal to 4. Additionally, the video coder may apply a block sizecondition. For example, the video coder may determine that, if thecurrent block is square or width * height is less than a certainthreshold, for example 64, the max values is equal to 3.

In one example, the video coder may context entropy code every bin oronly certain predetermined bins (e.g., an ordinal first number of bins)from the binarization codeword. The video coder may entropy code binsother than the predetermined bins without context modeling (e.g., inbypass mode). The context modelling can be separate for luma and chroma,if NSST is separately applied for luma and chroma. Alternatively, binsfrom binarization codeword can share the contexts for luma and chroma,for example, the context for the first bin indicating whether NSST indexis 0 (meaning NSST is not applied) can be shared between luma and chromacomponents, and other bins may have separate contexts for luma andchroma.

In another example, context modeling for the NSST index can depend onthe maximum value that NSST index can have. For example, if maximumvalues can be 3 or 4, one context set may be used to signal NSST indexfor maximum value 3, and another context set is used to signal NSSTindex for maximum value 4. Similar context sets can be defined for othermaximum values that NSST index can have, and more than two maximumvalues can be used.

Optionally, the context for the first bin, which indicates that NSSTindex is equal to 0 or not, can be shared across all context sets, orcan be shared across context sets corresponding to the same colorcomponent, such as for luma, chroma, or both chroma components, or allcolor components.

In the current JVET test model, NSST is not applied and NSST index isnot signaled if PDPC index is not equal to 0. This process of avoidingNSST and not signaling an NSST index may lower coding complexity.However, this disclosure recognizes that the process currentlyimplemented in the JVET test model does not necessarily achieve the bestcoding result and may not achieve the desired tradeoff between codercomplexity and bitrate.

In accordance with the techniques of this disclosure, a video coder(e.g., video encoder 20 or video decoder 30) need not apply and/or code(e.g., signal) a position dependent intra prediction combination (PDPC)syntax element for a block when an NSST index of the block has anon-zero value, i.e., in other words NSST method is applied to a currentblock. This may result in a similar coder complexity, but the resultingcompression efficiency may be higher because the NSST method usually hasbetter efficiency compared to PDPC. In this case, a PDPC index may besignaled in the bitstream at a location after the NSST index.

Additionally or alternatively, the NSST index context can be based onthe PDPC index. For example, one context may be used to entropy code theNSST index if PDPC index is 0, and another context may be used toentropy code the NSST index if PDPC index is not 0. In another example,each PDPC index may have its own context to be used to entropy code theNSST index. Additionally or alternatively, the context of NSST index candepend jointly on PDPC index and other elements of the current block,such as prediction mode, block size, and/or the like. Similarly, thecontext of PDPC index can dependent jointly on NSST index and otherelements of the current block, such as prediction mode, block size,and/or the like.

Alternatively, the same method can be applied if the NSST index is codedin the bitstream before the PDPC index. In this case, in the abovemethod, NSST and PDPC are swapped in the description. For example, onecontext may be used to entropy code the PDPC index if NSST index is 0,and another context may be used to entropy code the PDPC index if NSSTindex is not 0. In another example, each NSST index may have its owncontext to be used to entropy code the PDPC index. Additionally oralternatively, the context of PDPC index can depend jointly on NSSTindex and other elements of the current block, such as prediction mode,block size, and/or the like. Similarly, the context of NSST index candependent jointly on PDPC index and other elements of the current block,such as prediction mode, block size, and/or the like.

The PDPC techniques mentioned here can be extended to any othertechnique related to intra/inter prediction technique, and/or the NSSTtechnique mentioned here can be extended to any techniques related to atransform technique. The syntax element (index/flag/mode) signaling ofthe prediction technique may interact with the syntax element(index/flag/mode) signaling of the transform technique. The interactionmay be, but is not limited to, that the context of prediction techniquesyntax is dependent on the context of transform technique syntax or viceversa.

In addition, the video coder may be configured to apply the techniquesdiscussed above to other coding modes, including but not limited to PDPCor motion parameter inheritance (MPI) modes.

The NSST index may be signaled and shared for multiple components. Forexample, one NSST index may be signaled and shared for luminance (Y),blue hue chrominance (Cb), and red hue chrominance (Cr) components.Alternatively, one NSST index may be signaled and shared for Cb and Crcomponents (a separate NSST index may be signaled for the Y component).In some examples, when one NSST index is shared for multiple components,the NSST index signaling depends on some conditions, and when theseconditions are met for each of the included components, or when theseconditions are met for several (not all) of the included components, orthese conditions are met for any included components, NSST index is notsignaled but derived as a default value, e.g., 0.

These conditions may include but are not limited to: the number ofnon-zero coefficients (or the sum of absolute value of non-zerocoefficients) when the block is not coded by certain coding modes, andthese certain coding modes include but not limited to Transform Skipmode and/or LM mode and/or cross-component prediction mode.

The block in the above example can be a block for each componentconsidered independently, or it can be related blocks of some colorcomponents, for example, related blocks of Cb and Cr, or it can beblocks of all available components, for example, blocks if Y, Cb, andCr. Conditions may be jointly applied for those blocks together in oneexample.

For example, when the condition is applied to multiple components, e.g.,Cb and Cr, then the condition may include, but is not limited to, thesum of the number of non-zero coefficients (or the sum of absolute valueof non-zero coefficients) of each included component block is not codedby certain coding modes, and these certain coding modes include but notlimited to Transform Skip mode and/or LM mode and/or cross-componentprediction mode, and the like.

In some examples, when multiple NSST indices are signaled, and each NSSTindex is signaled for one or more components, multiple NSST indices maybe jointly binarized as one syntax element, and one binarization and/orcontext modeling may be applied for this jointly coded one syntaxelement. For example, a flag may first be coded to indicate whetherthere is at least one non-zero NSST index (meaning NSST is applied forat least one component). After the flag, the multiple NSST indices arebinarized as one syntax elements and coded. Some redundancy in signalingcan be removed in this example. For example, if the flag indicates thatthere is at least one non-zero NSST index, then the last signaled NSSTindex can be inferred to be non-zero if all preceding indices havevalues equal to 0.

In the above examples, a joint NSST index signaling technique can beapplied to signal NSST index for a group of blocks. The flag can besignaled for the group to indicate whether there is at least one blockusing non-zero NSST index, in this case flag is equal to 1, or allblocks have zero NSST index, in this case flag is equal to 0. Theredundancy in signaling can be removed for the last NSST index in thegroup as well, taking into account that the last NSST index cannot beequal to 0. In another example, if only two NSST indices (0 or 1) arepossible, the last index may not be signaled if all preceding indicesare equal to 0, the last NSST index can be inferred equal to 1. Inanother example, if more than two NSST index values are possible, thenthe last index can be reduced by 1 if all preceding indices are equal to0.

The above described techniques can be used in any combination.

NSST index was used as an example. The same techniques can be applied toany transform or secondary transform index, flag, or syntax elementssignaling. For example, these techniques can be applied to signal arotational transform (ROT) index.

Likewise, PDPC index was also used as an example. The same techniquescan be applied to any intra or inter prediction index, flag, or syntaxelements signaling. For example, these techniques can be applied tosignal a motion parameter inheritance (MPI) index.

In some examples, video encoder 20 and/or video decoder 30 may performtransform-related syntax coding (e.g., encoding/signaling ordecoding/interpreting) at a special structure unit, which may bereferred to as a signaling unit (SU). In general, a signaling unitincludes a plurality of blocks. For example, a signaling unit maycorrespond to a single quadtree-binary tree (QTBT) of a QTBT framework.Alternatively, a signaling unit may correspond to a group of blocks,each of the blocks corresponding to a different, respective QTBT.

In the QTBT framework, a signaling unit may be partitioned according toa multi-type tree including a first portion partitioned according to aquadtree (where each node is partitioned into zero or four child nodes),each leaf node of which may be further partitioned using binary treepartitioning (where each node is partitioned into zero or two childnodes). Each node that is partitioned into zero child nodes isconsidered a leaf node of the corresponding tree.

As discussed above, various syntax elements (such as NSST index, PDPCindex, prediction mode, block size, and the like) may be jointlysignaled for a group of blocks. Such joint signaling may generally bedescribed as “signaling data at a signaling unit level,” where asignaling unit includes a plurality of blocks to which data signaled atthe signaling unit level and such data applies to each block included inthe signaling unit.

A problem may arise when a signaling unit forms part of a non-I slice,such as P or B slices. In these or other non-I slices, the slices mayinclude some blocks predicted using intra-mode and other blockspredicted using inter-mode. However, some tools may apply to only one ofintra- or inter-mode, but not both. Therefore, signaling some syntax atthe signaling unit level for mixed blocks (intra and inter) may beinefficient, especially when the tool is not applied for a certainprediction mode.

Accordingly, this disclosure also describes a variety of techniques thatmay be used alone or in combination with each other and/or with thetechniques discussed above. Certain techniques of this disclosure may beapplied to resolve mixing of inter-and intra-predicted blocks in non-Islices, yet still have signaling for a signaling unit block. A videocoder may use blocks arranged in a signaling unit in a way that thesignaling unit only contains blocks that are affected by the signalingperformed at the signaling unit level.

For example, a transform may be of two types: first (or primary)transform and secondary transforms. A first transform, per the JVETmodel, can be a discrete cosine transform (DCT) or an enhanced multipletransform (EMT), and a secondary transform can be, for example, NSST andROT. It should be understood that DCT, EMT, NSST, and ROT are merelyexamples, and the techniques of this disclosure are not limited to thesetransforms, but that other transforms can be used as well (in additionor in the alternative).

Assuming, for purposes of example, that an EMT flag or EMT index issignaled at the signaling unit level, those syntax elements have valuesthat identify which particular transform is used for a block included inthe signaling unit. The block can be intra, inter, or skip modepredicted. The signaled EMT flag or EMT index can be efficient for intrapredicted blocks, but might be less efficient or be inefficient forinter predicted blocks. In this case, the signaling unit may furtherinclude either or both of the following types of blocks: 1)intra-predicted blocks and skip predicted blocks; and/or 2)inter-predicted blocks and skip predicted blocks.

According to this example, the transform related syntax signaled at thesignaling unit level would be efficient for intra coded blocks, but skipmode is based on the assumption that the residual is 0 and no transformis needed, so the signaled transform would not affect skip-predictedblocks and there would be no inter coded blocks present in thissignaling unit block. Similarly, transform related syntax signaled atthe signaling unit level for inter-predicted blocks is efficient forinter-predicted blocks, but it does not affect skip mode, and therewould be no intra coded blocks present in this signaling unit block,according to the signaling unit composition.

By arranging the signaling unit according to the techniques of thisdisclosure, certain syntax elements may become redundant. In the aboveexample, it is clear that prediction mode is not needed if the signalingunit type (#1 or #2) is signaled in addition to the transform syntaxelements at the signaling unit level. In this case, the prediction modeneed not be signaled for each block included the signaling unit, and theprediction mode can be inferred according to the signaling unit type. Inone example, the signaling unit type can be signaled as a separatesyntax element with a context specific to that syntax element, or aprediction mode syntax element can be reused and signaled to indicatethe signaling unit type.

As another example, a signaling unit may include blocks arrangedaccording to either or both of the following arrangements: 1)intra-predicted blocks, skip-predicted blocks, and inter-predictedblocks with residual equal to 0 (zero block); and/or 2) inter-predictedblocks, skip-predicted blocks, and intra-predicted blocks with zeroresidual.

In the first example discussed above, coded block flag (CBF) syntaxelements (indicating whether a block includes zero residual, that is,whether the block includes one or more non-zero residual values, i.e.,whether the block is “coded”) need not be signaled per inter-predictedblock for signaling unit type 1, and need not be signaled for theintra-predicted blocks for signaling unit type 2, since only zero blocksare possible.

In yet another example, a signaling unit can be composed as follows: (1)intra-predicted blocks, skip predicted blocks, and inter coded blockswith residual equal to 0 (zero block), and blocks coded with transformskip; and/or (2) inter-predicted blocks, skip predicted blocks, andintra-predicted blocks with zero residual, and blocks coded withtransform skip.

Similarly, as in the above example, CBF syntax elements need not besignaled per block included in the signaling unit.

In examples above, a signaling unit block was classified into two types“intra related” and “inter related” types. However, it might be stillpossible that a mixture of intra- and inter-blocks may share similartool decisions, for example, transform types might be the same for bothtypes of predicted blocks. Then, signaling unit types can be furtherextended into three: (1) intra-predicted blocks, and inter-predictedblocks with zero residual (skip, inter with zero residual or transformskipped inter blocks), (2) Inter-predicted blocks, and intra blocks withzero residual or transform skipped intra blocks, and (3) Inter and intramix is allowed without restriction.

In this example, some redundant syntax elements might not need to besignaled per block for signaling unit types 1 and 2 (i.e., within eachblock included in a signaling unit), such as prediction mode or CBFsyntax. Instead, video encoder 20 may encode and video decoder 30 maydecode those syntax elements once at the signaling unit level, and thecoded values may apply to each block included in the signaling unit.

In the above example, EMT or first transform was used as an example. Ina similar fashion, a secondary transform, such as NSST or ROT, can besignaled at the signaling unit level, and redundant syntax elements,such as prediction mode or CBF syntax, can be signaled at signaling unitlevel, and at block level those elements need not be signaled.

Video encoder 20 and video decoder 30 may use context modeling tocontext code (e.g., using CABAC) transform decision related syntaxelement. Transform related syntax elements, such as flags or indicesfrom the transform set, for example, but not limited to, EMT flag, NSSTflag, EMT index, NSST index, and the like, can be context coded. Contextcan be defined according to the number of non-zero transformcoefficients in a block, the absolute sum of non-zero transformcoefficients, and/or the positions of non-zero transform coefficientsinside a TU (e.g., whether only one non-zero DC coefficient is present).

Additionally, the number of non-zero coefficients can be classified intosome sub-groups; for example, the number of non-zero coefficients withincertain range is one sub-group, another range of values is anothersub-group and so on. Context can be defined per sub-group.

In addition, context can be defined based on the position of the lastnon-zero coefficient in the block, context can be also defined based onthe first non-zero coefficient in the blocks, and/or context can bedefined based on the values of the last and/or first coefficient in theblocks or their sign (negative or positive) in addition.

The following describes number of non-zero coefficient signaling.Currently, in HEVC or JVET, the position of the last non-zerocoefficient and significance map (for example, 0—coefficient is zero,1—coefficient is non-zero, or vice versa) is signaled for transformcoefficients, to indicate which coefficients are non-zero until the lastnon-zero coefficient.

However, if the block has just a few coefficients, then the currentsignaling of JVET and HEVC may not be efficient. For example, if thetransform block has only one non-zero coefficient and that coefficientis not in the beginning of the block, then the last position indicatesthe position of that coefficient already; however, the significance map,which contain all zeros, is still signaled.

This disclosure also describes techniques related to signaling anadditional syntax element, which has a value indicating the number ofnon-zero coefficients in the transform block. Video encoder 20 maysignal the value for this syntax element, and video decoder 30 maydecode a value for this syntax element to determine a number of non-zerotransform coefficients in the transform block. This syntax element valuecan be signaled using any binarization, such as unary, truncated unary,Golomb, Exponential Golomb, Rice, fixed length binary, truncated binarycodes and so on. For the truncated binarizations, the max element can bethe number of possible coefficients until the last position coefficient.

In one example, this new syntax element can be signaled after the lastnon-zero coefficient position for the transform block. In anotherexample, this new syntax element can be signaled before the lastnon-zero coefficient. In the latter case, the flag can indicate whetherthe block has only one DC coefficient.

Since the last non-zero coefficient and the number of non-zerocoefficients are signaled, the techniques of this disclosure may resultin reduction in size of the coded significance map forming part of thebitstream. For example, while signaling the significance map, the numberof already-signaled non-zero coefficients can be counted; when thenumber of non-zero coefficients equal to the signaled number of non-zerocoefficients minus 1 is already signaled, there is no need to continuesignaling the significance map for a block, since the only possible nextnon-zero coefficient is the last coefficient in block.

In one example, the above-mentioned syntax element can be a flag (onecoefficient flag) indicating whether the transform block has only onenon-zero coefficient. This flag can be signaled after the position ofthe last non-zero coefficient and also can be conditioned on that. Forexample, if the last non-zero coefficient is the first coefficient (DC)in the block, then it is already known that only one coefficient ispossible, and the one coefficient flag is not needed. Similarly, theflag can be signaled only for the cases when the position of the lastnon-zero coefficient is greater than a certain threshold. For example,if the last non-zero coefficient position is a certain distance from thebeginning of the block, then the one coefficient flag is signaled.

Context model selection for the one coefficient flag may depend on theposition of the last non-zero coefficient in the block, the distancefrom the beginning of the block of that last position, last non-zerocoefficient value, and/or sign of that value, alone or in anycombination.

One coefficient flag can be signaled after the position of the lastnon-zero coefficient, in another alternative after the position of thelast non-zero coefficient and its value, in yet another alternativeafter the position of the last non-zero coefficient, its value and sign.This can be dependent on which context modeling is applied (see above).

In yet another example, one coefficient flag may be signaled before thelast non-zero coefficient position, and may indicate whether the blockhas only one DC (first transform coefficient) coefficient. In suchexample, the last non-zero coefficient position can be conditioned onthat flag, and signaled when the flag has a value representing“disabled,” meaning that there is more than one non-zero coefficient orone coefficient is not DC coefficient. Furthermore, the last positionsignaling can be modified by subtracting 1 from the positioncoordinates, since the last position equal to the DC coefficient cannotbe signaled if the one coefficient flag is disabled; otherwise, thatflag would be enabled.

When such one coefficient flag is signaled and has a value representing“enabled” (i.e., that the block has only one non-zero coefficient), thesignificance map may not be needed, and the position of the lastcoefficient and its value with sign may only be signaled. Thus, videoencoder 20 may only signal the position of the last coefficient, andvideo decoder 30 may only receive data representing the position of thelast coefficient and determine that subsequent data of the bitstreamapplies to a different set of syntax elements (e.g., of the same blockbut unrelated to transform coefficient data, or syntax elements of asubsequent block).

The one coefficient flag may be signaled conditionally on whichtransform type is used, for example DCT or EMT, and may be dependent onEMT flag or EMT index. Additionally, the one coefficient flag signalingcan be dependent on whether the secondary transform, such as NSST orROT, is used in a block; secondary transform syntax, such as NSST flag,NSST index, ROT flag, or ROT index; and the like. For example, ifsecondary transform is used, the flag may not be signaled.

More detailed examples described for one non-zero coefficient flag canbe applied for cases when more than one non-zero coefficient value issignaled in the block.

Video encoder 20 and video decoder 30 may switch between differenttransform types based on non-zero coefficients. Two different types oftransforms may be used, e.g., one is a separable transform and the otheris non-separable transform. For the usage of each type of transform,some restrictions may be added that the non-zero coefficients can onlybe present for certain positions inside a transform unit. In this way,the selected type of transform is not signaled, but video decoder 30 canderive the selected type of transform, after decoding the coefficients,according to the positions of the non-zero coefficients inside atransform unit. By deriving the transform type instead of receivingexplicit signaling, the encoded video bitstream size can be reduced,which may thereby improve bitstream efficiency, without introducingexcess complexity into video decoder 30, and without loss of quality inthe resulting decoded video data. Furthermore, providing multiple typesof transforms in this way may result in even further improvement ofbitstream efficiency, in that the resulting transform types may bettercompress residual data, on average.

In one example, if at least one non-zero coefficient is present afterthe N^(th) coefficient in scan order (where N can be pre-defined orderived based on some conditions), the separable transform is applied;otherwise (all non-zero coefficients are only present in the first Ncoefficients in scan order) the non-separable transform is applied.

In another example, the type of transform is still signaled by aflag/index, but the context model for entropy coding (entropy encodingor entropy decoding) the coefficient at different positions may dependon the value of signaled flag/index.

In another example, the flag or index to indicate the transform choicementioned above is signaled after the N^(th) coefficient or allcoefficients. The flag or index can be context coded, where the contextis dependent on the position of the last non-zero coefficient. Forexample, the context may be dependent on whether the last non-zerocoefficient happens before the N^(th) coefficient, or after it. If thelast non-zero coefficient stops at the N^(th) coefficient itself, thecontext model can be associated with either group, before or afterN^(th) coefficient mentioned earlier, or a separate context might beassigned.

Video encoder 20 may encode/signal syntax elements for a signaling unit,while video decoder 30 may decode and interpret values for the syntaxelements of the signaling unit. As described earlier, syntax elementscan be signaled at a signaling unit level. However, some syntax elementsmay not be applicable to every block included into the signaling unit.

For example, a secondary transform, such as NSST, may only be applied tointra-predicted blocks, which have non-zero coefficients. It can be thecase that there is no block in a signaling unit to which a secondarytransform is to be applied. For such cases, signaling NSST information,for example NSST index or NSST flag, for such signaling unit is notneeded and may just waste bits. In another example, a first transform,such as EMT, is applied to non-zero residual blocks. In can be also thecase that all blocks included in a signaling unit have zero residual,and signaling EMT information, for example EMT flag or EMT index, is notneeded for such signaling unit and may just waste bits.

In some examples, video encoder 20 may postpone signaling unit syntaxsignaling until the first block included in the signaling unit to whichsuch signaling is applicable. In other words, signaling unit syntax isnot signaled for the blocks that are at the beginning of a signalingunit in scanning order, to which such signaling in not applicable.Likewise, video decoder 30 would only apply values of signaling unitsyntax elements to blocks following the signaling unit syntax elementsin the signaling unit.

For example, video encoder 20 may not signal some types of informationapplicable to all blocks within the signaling unit until there is ablock in the signaling unit to which the information is applicable.Similarly, video decoder 30 may not parse some types of informationapplicable to all blocks within the signaling unit until there is ablock in the signaling unit to which the information is applied. Theinformation may be information identifying a particular coding tool,syntax elements, or the like.

As an example, video encoder 20 may signal, and video decoder 30 mayreceive, NSST information (index, flag, etc.) in the first intra blockhaving non-zero residual in a signaling unit. In another example, videoencoder 20 may signal, and video decoder 30 may receive, EMT information(index, flag, etc.) at the first non-zero block in a signaling unit.These blocks may not necessarily be at the beginning of a correspondingsignaling unit. In some examples, once the syntax elements (e.g.,information for a coding tool or other types of syntax elements) issignaled for the first block that uses the syntax element, then thatinformation may be uniform for all blocks following that first block inblock scanning order that use the syntax element. However, this shouldnot be considered a requirement in all cases.

By postponing the signaling of the signaling unit syntax elements, thebits associated with the syntax elements can be saved if there are noblocks in a signaling unit that need such syntax elements or there areno blocks in the signaling unit to which such signaling can be applied,as compared to signaling and receiving techniques where a syntax elementis always signaled at the signaling unit level, regardless of whether asignaling unit includes any blocks to which such syntax elements wouldbe applicable.

Video encoder 20 may utilize similar techniques to postpone other syntaxelement (not necessarily transform related) signaling at the signalingunit level, depending on the signaled information and block typesincluded in the signaling unit, to which such information is applicable.The above examples of postponing the signaling and parsing ofinformation of signaling units should not be considered limiting.

Various syntax elements may be considered specific to a signaling unit.Some syntax elements can be introduced only for a signaling unit and maynot be present for other blocks. For example, such syntax elements canbe control flags and coding mode related parameters. In one example,signaling unit syntax elements include any or all of a first transform(for example, EMT) and/or a secondary transform syntax elements (forexample, NSST or ROT flags and/or indices) as mentioned earlier, andsuch syntax elements need not be present for blocks larger than asignaling unit or not included in a signaling unit.

Alternatively or additionally, existing syntax elements of a blocksignaled for a signaling unit may have different range values ordifferent semantics/interpretation than the same syntax elementssignaled for the blocks larger than a signaling unit or not included ina signaling unit. In one example, a non-zero coefficient thresholdidentifying when to signal first transform and secondary transformsyntax elements may be different for a signaling unit than for otherblocks. Such thresholds may be larger or smaller than correspondingthreshold for other blocks.

For example, a secondary transform (such as, NSST or ROT) index and/orflag can be signaled for a block in a signaling unit having at least onenon-zero transform coefficient, and a secondary transform index can besignaled for a block larger than a signaling unit or not included in asignaling unit if the block has at least two non-zero coefficients. Whena secondary transform index is not signaled, video decoder 30 infers thevalue of the secondary transform index, for example, as being equal to adefault value, such as 0. The same technique can be applied to a firsttransform or any other transform.

Such signaling unit specific parameters may also be different accordingto a slice type and/or tile to which the signaling unit belongs. Forexample, I-, P-, and B-slices may have different signaling unitparameters, different range values, or differentsemantics/interpretation.

The signaling unit parameters described above are not limited to atransform, but can be used with any coding mode or can be introduced toany mode.

Video encoder 20 may further send syntax data, such as block-basedsyntax data, picture-based syntax data, and sequence-based syntax data,to video decoder 30, e.g., in a picture header, a block header, a sliceheader, or other syntax data, such as a sequence parameter set (SPS),picture parameter set (PPS), or video parameter set (VPS).

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder or decoder circuitry, as applicable, suchas one or more microprocessors, digital signal processors (DSPs),application specific integrated circuits (ASICs), field programmablegate arrays (FPGAs), discrete logic circuitry, software, hardware,firmware or any combinations thereof. Each of video encoder 20 and videodecoder 30 may be included in one or more encoders or decoders, eitherof which may be integrated as part of a combined video encoder/decoder(CODEC). A device including video encoder 20 and/or video decoder 30 maycomprise an integrated circuit, a microprocessor, and/or a wirelesscommunication device, such as a cellular telephone.

FIG. 2 is a block diagram illustrating an example of video encoder 20that may implement techniques for binarizing a secondary transformindex. Video encoder 20 may perform intra- and inter-coding of videoblocks within video slices. Intra-coding relies on spatial prediction toreduce or remove spatial redundancy in video within a given video frameor picture. Inter-coding relies on temporal prediction to reduce orremove temporal redundancy in video within adjacent frames or picturesof a video sequence. Intra-mode (I mode) may refer to any of severalspatial based coding modes. Inter-modes, such as uni-directionalprediction (P mode) or bi-prediction (B mode), may refer to any ofseveral temporal-based coding modes.

As shown in FIG. 2, video encoder 20 receives a current video blockwithin a video frame to be encoded. In the example of FIG. 2, videoencoder 20 includes mode select unit 40, reference picture memory 64(which may also be referred to as a decoded picture buffer (DPB)),summer 50, transform processing unit 52, quantization unit 54, andentropy encoding unit 56. Mode select unit 40, in turn, includes motioncompensation unit 44, motion estimation unit 42, intra-prediction unit46, and partition unit 48. For video block reconstruction, video encoder20 also includes inverse quantization unit 58, inverse transform unit60, and summer 62. A deblocking filter (not shown in FIG. 2) may also beincluded to filter block boundaries to remove blockiness artifacts fromreconstructed video. If desired, the deblocking filter would typicallyfilter the output of summer 62. Additional filters (in loop or postloop) may also be used in addition to the deblocking filter. Suchfilters are not shown for brevity, but if desired, may filter the outputof summer 50 (as an in-loop filter).

During the encoding process, video encoder 20 receives a video frame orslice to be coded. The frame or slice may be divided into multiple videoblocks. Motion estimation unit 42 and motion compensation unit 44perform inter-predictive encoding of the received video block relativeto one or more blocks in one or more reference frames to providetemporal prediction. Intra-prediction unit 46 may alternatively performintra-predictive encoding of the received video block relative to one ormore neighboring blocks in the same frame or slice as the block to becoded to provide spatial prediction. Video encoder 20 may performmultiple coding passes, e.g., to select an appropriate coding mode foreach block of video data.

Moreover, partition unit 48 may partition blocks of video data intosub-blocks, based on evaluation of previous partitioning schemes inprevious coding passes. For example, partition unit 48 may initiallypartition a frame or slice into CTUs, and partition each of the CTUsinto sub-CUs based on rate-distortion analysis (e.g., rate-distortionoptimization). Mode select unit 40 may further produce a quadtree datastructure indicative of partitioning of a CTU into sub-CUs. Leaf-nodeCUs of the quadtree may include one or more PUs and one or more TUs.

Mode select unit 40 may select one of the prediction modes, intra orinter, e.g., based on error results, and provides the resultingpredicted block to summer 50 to generate residual data and to summer 62to reconstruct the encoded block for use as a reference frame. Modeselect unit 40 also provides syntax elements, such as motion vectors,intra-mode indicators, partition information, and other such syntaxinformation, to entropy encoding unit 56.

Motion estimation unit 42 and motion compensation unit 44 may be highlyintegrated, but are illustrated separately for conceptual purposes.Motion estimation, performed by motion estimation unit 42, is theprocess of generating motion vectors, which estimate motion for videoblocks. A motion vector, for example, may indicate the displacement of aPU of a video block within a current video frame or picture relative toa predictive block within a reference frame (or other coded unit)relative to the current block being coded within the current frame (orother coded unit). A predictive block is a block that is found toclosely match the block to be coded, in terms of pixel difference, whichmay be determined by sum of absolute difference (SAD), sum of squaredifference (SSD), or other difference metrics. In some examples, videoencoder 20 may calculate values for sub-integer pixel positions ofreference pictures stored in reference picture memory 64. For example,video encoder 20 may interpolate values of one-quarter pixel positions,one-eighth pixel positions, or other fractional pixel positions of thereference picture. Therefore, motion estimation unit 42 may perform amotion search relative to the full pixel positions and fractional pixelpositions and output a motion vector with fractional pixel precision.

Motion estimation unit 42 calculates a motion vector for a PU of a videoblock in an inter-coded slice by comparing the position of the PU to theposition of a predictive block of a reference picture. The referencepicture may be selected from a first reference picture list (List 0) ora second reference picture list (List 1), each of which identify one ormore reference pictures stored in reference picture memory 64. Motionestimation unit 42 sends the calculated motion vector to entropyencoding unit 56 and motion compensation unit 44.

Motion compensation, performed by motion compensation unit 44, mayinvolve fetching or generating the predictive block based on the motionvector determined by motion estimation unit 42. Again, motion estimationunit 42 and motion compensation unit 44 may be functionally integrated,in some examples. Upon receiving the motion vector for the PU of thecurrent video block, motion compensation unit 44 may locate thepredictive block to which the motion vector points in one of thereference picture lists. Summer 50 forms a residual video block bysubtracting pixel values of the predictive block from the pixel valuesof the current video block being coded, forming pixel difference values,as discussed below. In general, motion estimation unit 42 performsmotion estimation relative to luma components, and motion compensationunit 44 uses motion vectors calculated based on the luma components forboth chroma components and luma components. Mode select unit 40 may alsogenerate syntax elements associated with the video blocks and the videoslice for use by video decoder 30 in decoding the video blocks of thevideo slice.

Intra-prediction unit 46 may intra-predict a current block, as analternative to the inter-prediction performed by motion estimation unit42 and motion compensation unit 44, as described above. In particular,intra-prediction unit 46 may determine an intra-prediction mode to useto encode a current block. In some examples, intra-prediction unit 46may encode a current block using various intra-prediction modes, e.g.,during separate encoding passes, and intra-prediction unit 46 (or modeselect unit 40, in some examples) may select an appropriateintra-prediction mode to use from the tested modes.

For example, intra-prediction unit 46 may calculate rate-distortionvalues using a rate-distortion analysis for the various testedintra-prediction modes, and select the intra-prediction mode having thebest rate-distortion characteristics among the tested modes.Rate-distortion analysis generally determines an amount of distortion(or error) between an encoded block and an original, unencoded blockthat was encoded to produce the encoded block, as well as a bitrate(that is, a number of bits) used to produce the encoded block.Intra-prediction unit 46 may calculate ratios from the distortions andrates for the various encoded blocks to determine which intra-predictionmode exhibits the best rate-distortion value for the block.

After selecting an intra-prediction mode for a block, intra-predictionunit 46 may provide information indicative of the selectedintra-prediction mode for the block to entropy encoding unit 56. Entropyencoding unit 56 may encode the information indicating the selectedintra-prediction mode. Video encoder 20 may include in the transmittedbitstream configuration data, which may include a plurality ofintra-prediction mode index tables and a plurality of modifiedintra-prediction mode index tables (also referred to as codeword mappingtables), definitions of encoding contexts for various blocks, andindications of a most probable intra-prediction mode, anintra-prediction mode index table, and a modified intra-prediction modeindex table to use for each of the contexts.

Video encoder 20 forms a residual video block by subtracting theprediction data from mode select unit 40 from the original video blockbeing coded. Summer 50 represents the component or components thatperform this subtraction operation. Transform processing unit 52 appliesa transform, such as a discrete cosine transform (DCT) or a conceptuallysimilar transform, to the residual block, producing a video blockcomprising transform coefficient values. Wavelet transforms, integertransforms, sub-band transforms, discrete sine transforms (DSTs), orother types of transforms could be used instead of a DCT. In any case,transform processing unit 52 applies the transform to the residualblock, producing a block of transform coefficients. The transform mayconvert the residual information from a pixel domain to a transformdomain, such as a frequency domain.

In addition, in some examples, e.g., when a block is intra-predicted,transform processing unit 52 may apply a secondary transform, such as anon-separable secondary transform (NSST) to the transform coefficientsresulting from the first transform. Transform processing unit 52 mayalso pass one or more values for secondary transform syntax elements forthe block to entropy encoding unit 56, to be entropy encoded. Entropyencoding unit 56 may entropy encode these and/or other syntax elements(e.g., secondary transform syntax elements or other signaling unitsyntax elements) as discussed in greater detail below with respect toFIG. 3, in accordance with the techniques of this disclosure.

Transform processing unit 52 may send the resulting transformcoefficients to quantization unit 54. Quantization unit 54 quantizes thetransform coefficients to further reduce bit rate. The quantizationprocess may reduce the bit depth associated with some or all of thecoefficients. The degree of quantization may be modified by adjusting aquantization parameter.

Following quantization, entropy encoding unit 56 entropy encodes thequantized transform coefficients (and any corresponding values forrelated syntax elements, such as secondary transform syntax elements,signaling unit syntax elements, coding tool syntax elements, enhancedmultiple transform (EMT) syntax elements, or the like). For example,entropy encoding unit 56 may perform context adaptive variable lengthcoding (CAVLC), context adaptive binary arithmetic coding (CABAC),syntax-based context-adaptive binary arithmetic coding (SBAC),probability interval partitioning entropy (PIPE) coding or anotherentropy coding technique. In the case of context-based entropy coding,context may be based on neighboring blocks. Following the entropy codingby entropy encoding unit 56, the encoded bitstream may be transmitted toanother device (e.g., video decoder 30) or archived for latertransmission or retrieval.

In accordance with the techniques of this disclosure, video encoder 20may encode certain syntax elements at a signaling unit level. Asignaling unit generally includes syntax elements pertaining to two ormore blocks (e.g., coding tree blocks (CTBs) or coding units (CUs)) ofvideo data. For example, the blocks may correspond to differentbranches/nodes of a common QTBT structure, or to distinct QTBTstructures.

As discussed above, in one example, video encoder 20 may postponesignaling syntax elements of a signaling unit until video encoder 20encounters a block to which those signaling unit syntax elements arepertinent. In this manner, video encoder 20 may avoid encoding thesignaling unit syntax elements entirely, if the signaling unitultimately does not include any blocks to which the signaling unitsyntax elements are pertinent. If the signaling unit does contain blocksto which the signaling unit syntax elements are pertinent, video encoder20 may encode these syntax elements to form part of the bitstreamfollowing the block to which the signaling unit syntax elements do notpertain, and preceding the block(s) to which the signaling unit syntaxelements do pertain, in encoding/decoding order. The signaling unitsyntax elements may include any or all of NSST information (NSST flagsand/or indexes), EMT information (EMT flags and/or indexes), or thelike.

For example, mode select unit 40 may determine whether anintra-predicted block yields a zero or non-zero residual (as calculatedby summer 50). Mode select unit 40 may await determination of signalingunit syntax elements for a signaling unit until an intra-predicted blockhas been encoded that has a non-zero residual (i.e., a residual blockhaving at least one non-zero coefficient). After identifying anintra-predicted block having a non-zero residual, mode select unit 40may determine one or more signaling unit syntax elements to be encodedfor a signaling unit including the intra-predicted block, and moreover,entropy encoding unit 56 may entropy encode values for the signalingunit syntax elements at a position following other blocks of thesignaling unit but preceding the intra-predicted block of the signalingunit in encoding/decoding order.

Inverse quantization unit 58 and inverse transform unit 60 apply inversequantization and inverse transformation, respectively, to reconstructthe residual block in the pixel domain. In particular, summer 62 addsthe reconstructed residual block to the motion compensated predictionblock earlier produced by motion compensation unit 44 orintra-prediction unit 46 to produce a reconstructed video block forstorage in reference picture memory 64. The reconstructed video blockmay be used by motion estimation unit 42 and motion compensation unit 44as a reference block to inter-code a block in a subsequent video frame.

Video encoder 20 of FIG. 2 represents an example of a video encoder thatcan be configured to determine a maximum value for a secondary transform(e.g., a non-separable secondary transform (NSST)) syntax element for ablock of video data, and binarize the value for the secondary transform(e.g., NSST) syntax element based on the determined maximum value. Videoencoder 20 may further entropy encode the value for the secondarytransform (e.g., NSST) syntax element.

FIG. 3 is a block diagram of an example entropy encoding unit 56 thatmay be configured to perform CABAC in accordance with the techniques ofthis disclosure. Entropy encoding unit 56 initially receives syntaxelement 118. If syntax element 118 is already binary-value syntaxelement, the step of binarization may be skipped. If syntax element 118is a non-binary valued syntax element, binarizer 120 binarizes syntaxelement.

Binarizer 120 performs a mapping of a non-binary value into a sequenceof binary decisions. These binary decisions may be referred to as“bins.” For example, for transform coefficient levels, the value of thelevel may be broken down into successive bins, each bin indicatingwhether or not the absolute value of coefficient level is greater thansome value. For example, for transform coefficients, bin 0 (sometimescalled a significance flag) indicates if the absolute value of thetransform coefficient level is greater than 0 or not; bin 1 indicates ifthe absolute value of the transform coefficient level is greater than 1or not; and so on. A unique mapping may be developed for each non-binaryvalued syntax element.

Binarizer 120 passes each bin to the binary arithmetic encoding side ofentropy encoding unit 56. That is, for a predetermined set of non-binaryvalued syntax elements, each bin type (e.g., bin 0) is encoded beforethe next bin type (e.g., bin 1). In accordance with the techniques ofthis disclosure, when binarizing a value of a secondary transform syntaxelement (such as a non-separable secondary transform (NSST) syntaxelement) of a block of video data that was intra-predicted, binarizer120 may determine a maximum possible value of the secondary transform(e.g., NSST) syntax element for the block, e.g., based on anintra-prediction mode used to predict the block and/or other parameters,such as a size of the block.

In one example, binarizer 120 determines that the maximum possible valuefor an NSST index is equal to 3 if the intra-prediction mode for theblock was DC, planar, or LM mode for chroma components, and otherwisethat the maximum possible value for the NSST index is equal to 4.Binarizer 120 then binarizes the actual value for the NSST index basedon the determined maximum possible value, using a common binarizationtechnique regardless of the determined maximum possible value (e.g.,using truncated unary binarization regardless of whether the determinedmaximum possible value for the NSST index is 3 or 4).

Entropy encoding may be performed in either regular mode or bypass mode.In bypass mode, bypass encoding engine 126 performs arithmetic encodingusing a fixed probability model, for example, using Golomb-Rice orexponential Golomb encoding. Bypass mode is generally used for morepredictable syntax elements.

Entropy encoding in regular mode CABAC involves performing context-basedbinary arithmetic encoding. Regular mode CABAC is typically performed toencode bin values for which the probability of the value of the bin ispredictable given the values of previously coded bins. Context modeler122 determines the probability of a bin being a least probable symbol(LPS). Context modeler 122 outputs the bin value and the context model(e.g., the probability state σ) to regular encoding engine 124. Thecontext model may be an initial context model for a series of bins, orcontext modeler 122 may determine the context model based on the codedvalues of previously encoded bins. Context modeler 122 may update thecontext state based on whether or not the previously-coded bin was anMPS or an LPS.

In accordance with the techniques of this disclosure, context modeler122 may be configured to determine a context model for entropy encodinga secondary transform syntax element (such as an NSST syntax element)based on a determined maximum possible value for the secondary transformsyntax element discussed above.

After context modeler 122 determines the context model and probabilitystate σ, regular encoding engine 124 performs BAC on the bin value,using the context model. Alternatively, in bypass mode, bypass encodingengine 126 bypass encodes the bin values from binarizer 120. In eithercase, entropy encoding unit 56 outputs an entropy encoded bitstreamincluding the entropy encoded data.

In this manner, video encoder 20 of FIGS. 1 and 2 (and entropy encodingunit 56 thereof, described with respect to FIG. 3) represents an exampleof a video encoder including a memory configured to store video data andone or more processors implemented in circuitry and configured to,transform intermediate transform coefficients of a block of video datausing a secondary transform, determine a maximum possible value for asecondary transform syntax element for the block, a value of thesecondary transform syntax element representing the secondary transform,binarize the value for the secondary transform syntax element using acommon binarization scheme regardless of the maximum possible value, andentropy encode the binarized value for the secondary transform syntaxelement of the block to form a binarized value representative of thesecondary transform for the block.

FIG. 4 is a block diagram illustrating an example of video decoder 30that may implement techniques for binarizing a secondary transformindex. In the example of FIG. 4, video decoder 30 includes an entropydecoding unit 70, motion compensation unit 72, intra prediction unit 74,inverse quantization unit 76, inverse transformation unit 78, referencepicture memory 82 and summer 80. Video decoder 30 may, in some examples,perform a decoding pass generally reciprocal to the encoding passdescribed with respect to video encoder 20 (FIG. 2).

In some examples, entropy decoding unit 70 decodes certain syntaxelements of a signaling unit. For example, video decoder 30 maydetermine that two or more blocks of video data correspond to a commonsignaling unit. Entropy decoding unit 70 may entropy decode syntaxelements for the signaling unit in accordance with the techniques ofthis disclosure. For example, entropy decoding unit 70 may entropydecode secondary transform syntax elements (such as non-separablesecondary transform (NSST) indexes and/or flags), enhanced multipletransform (EMT) syntax elements (e.g., EMT indexes and/or flags), or thelike. Entropy decoding unit 70 may entropy decode signaling unit syntaxelements following one or more blocks of a signaling unit but precedingone or more other blocks of the signaling unit, and apply values of thesignaling unit syntax elements only to the blocks following the syntaxelements in decoding order.

Moreover, video decoder 30 may infer certain data from the presence ofthe syntax elements, e.g., that a block immediately following thesesignaling unit syntax elements is inter-predicted and has a non-zeroresidual. Thus, video decoder may determine that related block-levelsyntax elements (e.g., indicating that the block is intra-predicted andthat the block is coded, i.e., has non-zero residual values) are notpresent in the bitstream, and thereby, determine that subsequent data ofthe bitstream applies to other syntax elements.

Furthermore, entropy decoding unit 70 may entropy decode data asdiscussed in greater detail below with respect to FIG. 5. For example,in accordance with the techniques of this disclosure, entropy decodingunit 70 may reverse binarize secondary transform syntax element valuesusing a common binarization scheme (e.g., truncated unary binarization)regardless of a maximum possible value for the secondary transformsyntax element values.

Motion compensation unit 72 may generate prediction data based on motionvectors received from entropy decoding unit 70, while intra-predictionunit 74 may generate prediction data based on intra-prediction modeindicators received from entropy decoding unit 70.

During the decoding process, video decoder 30 receives an encoded videobitstream that represents video blocks of an encoded video slice andassociated syntax elements from video encoder 20. Entropy decoding unit70 of video decoder 30 entropy decodes the bitstream to generatequantized coefficients, motion vectors or intra-prediction modeindicators, and other syntax elements. Entropy decoding unit 70 forwardsthe motion vectors to and other syntax elements to motion compensationunit 72. Video decoder 30 may receive the syntax elements at the videoslice level and/or the video block level.

When the video slice is coded as an intra-coded (I) slice, intraprediction unit 74 may generate prediction data for a video block of thecurrent video slice based on a signaled intra prediction mode and datafrom previously decoded blocks of the current frame or picture. When thevideo frame is coded as an inter-coded (i.e., B or P) slice, motioncompensation unit 72 produces predictive blocks for a video block of thecurrent video slice based on the motion vectors and other syntaxelements received from entropy decoding unit 70 (assuming the videoblock is inter-predicted). Inter-predictive blocks may be produced fromone of the reference pictures within one of the reference picture lists.Video decoder 30 may construct the reference frame lists, List 0 andList 1, using default construction techniques based on referencepictures stored in reference picture memory 82. Blocks of P and B slicesmay also be intra-predicted.

Motion compensation unit 72 determines prediction information for avideo block of the current video slice by parsing the motion vectors andother syntax elements, and uses the prediction information to producethe predictive blocks for the current video block being decoded. Forexample, motion compensation unit 72 uses some of the received syntaxelements to determine a prediction mode (e.g., intra- orinter-prediction) used to code the video blocks of the video slice, aninter-prediction slice type (e.g., B slice or P slice), constructioninformation for one or more of the reference picture lists for theslice, motion vectors for each inter-encoded video block of the slice,inter-prediction status for each inter-coded video block of the slice,and other information to decode the video blocks in the current videoslice.

Motion compensation unit 72 may also perform interpolation based oninterpolation filters. Motion compensation unit 72 may use interpolationfilters as used by video encoder 20 during encoding of the video blocksto calculate interpolated values for sub-integer pixels of referenceblocks. In this case, motion compensation unit 72 may determine theinterpolation filters used by video encoder 20 from the received syntaxelements and use the interpolation filters to produce predictive blocks.

Inverse quantization unit 76 inverse quantizes, i.e., de-quantizes, thequantized transform coefficients provided in the bitstream and decodedby entropy decoding unit 70. The inverse quantization process mayinclude use of a quantization parameter QP_(Y) calculated by videodecoder 30 for each video block in the video slice to determine a degreeof quantization and, likewise, a degree of inverse quantization thatshould be applied.

Inverse transform unit 78 applies an inverse transform, e.g., an inverseDCT, an inverse integer transform, or a conceptually similar inversetransform process, to the transform coefficients in order to produceresidual blocks in the pixel domain.

After motion compensation unit 72 generates the predictive block for thecurrent video block based on the motion vectors and other syntaxelements, video decoder 30 forms a decoded video block by summing theresidual blocks from inverse transform unit 78 with the correspondingpredictive blocks generated by motion compensation unit 72. Summer 80represents the component or components that perform this summationoperation. If desired, a deblocking filter may also be applied to filterthe decoded blocks in order to remove blockiness artifacts. Other loopfilters (either in the coding loop or after the coding loop) may also beused to smooth pixel transitions, or otherwise improve the videoquality. The decoded video blocks in a given frame or picture are thenstored in reference picture memory 82, which stores reference picturesused for subsequent motion compensation. Reference picture memory 82also stores decoded video for later presentation on a display device,such as display device 32 of FIG. 1.

Video decoder 30 of FIG. 4 represents an example of a video decoder thatcan be configured to determine a maximum value for a secondary transform(e.g., non-separable secondary transform (NSST)) syntax element for ablock of video data, and binarize the value for the NSST syntax elementbased on the determined maximum value. Video decoder 30 may furtherentropy decode the value for the NSST syntax element.

FIG. 5 is a block diagram of an example entropy encoding unit 70 thatmay be configured to perform CABAC in accordance with the techniques ofthis disclosure. The entropy decoding unit 70 of FIG. 5 performs CABACin an inverse manner as that of entropy encoding unit 56 described inFIG. 5. Entropy decoding unit 70 receives entropy encoded bits frombitstream 218. Entropy decoded unit 70 provides the entropy encoded bitsto either context modeler 220 or bypass decoding engine 222, based onwhether or not the entropy encoded bits were entropy encoded usingbypass mode or regular mode. If the entropy encoded bits were entropyencoded in bypass mode, bypass decoding engine 222 uses bypass decoding,such as Golomb-Rice or exponential Golomb decoding, for example, toentropy decode the entropy encoded bits.

If the entropy encoded bits were entropy encoded in regular mode,context modeler 220 may determine a probability model for the entropyencoded bits and regular decoding engine 224 may entropy decode theentropy encoded bits to produce bins of non-binary valued syntaxelements (or the syntax elements themselves if binary-valued).

Context modeler 220 may determine context models and probability statesfor certain syntax elements, such as secondary transform syntax elementsand/or enhanced multiple transform (EMT) syntax elements (e.g., NSSTindexes, NSST flags, EMT indexes, EMT flags, or the like) using thetechniques of this disclosure. For example, context modeler 220 maydetermine the context models based on a determined maximum possiblevalue of an NSST syntax element. Entropy decoding unit 70 may determinethe maximum possible value of the NSST syntax element based on, e.g., anintra-prediction mode for a block to which the NSST syntax elementcorresponds and/or a size of the block.

After context modeler 220 determines the context model and probabilitystate σ, regular decoding engine 224 performs binary arithmetic decodingon the bin value, based on the determined context model.

After regular decoding engine 224 or bypass decoding engine 222 entropydecodes the bins, reverse binarizer 230 may perform a reverse mapping toconvert the bins back into the values of the non-binary valued syntaxelements. In accordance with the techniques of this disclosure, reversebinarizer 230 may reverse binarize secondary transform syntax elementvalues (such as NSST, ROT, and/or EMT values) using a commonbinarization scheme (e.g., truncated unary binarization), regardless ofa maximum possible value for the secondary transform syntax elementvalues.

For example, when reverse binarizing a value of a secondary transformsyntax element (such as a non-separable secondary transform (NSST)syntax element) of a block of video data that was intra-predicted,reverse binarizer 230 may determine a maximum possible value of thesecondary transform (e.g., NSST) syntax element for the block, e.g.,based on an intra-prediction mode used to predict the block and/or otherparameters, such as a size of the block.

In one example, reverse binarizer 230 determines that the maximumpossible value for an NSST index is equal to 3 if the intra-predictionmode for the block was DC, planar, or LM mode for chroma components, andotherwise that the maximum possible value for the NSST index is equal to4. Reverse binarizer 230 then reverse binarizes the actual value for theNSST index from the entropy decoded bin string based on the determinedmaximum possible value, using a common binarization technique regardlessof the determined maximum possible value (e.g., using truncated unaryreverse binarization, regardless of whether the determined maximumpossible value for the NSST index is 3 or 4).

In this manner, video decoder 30 of FIGS. 1 and 4 (including entropydecoding unit 70, described with respect to FIG. 5) represents anexample of a video decoder including a memory configured to store videodata and one or more processors implemented in circuitry and configuredto determine a maximum possible value for a secondary transform syntaxelement for a block of video data, entropy decode a value for thesecondary transform syntax element of the block to form a binarizedvalue representative of the secondary transform for the block, reversebinarize the value for the secondary transform syntax element using acommon binarization scheme regardless of the maximum possible value todetermine the secondary transform for the block, and inverse-transformtransform coefficients of the block using the determined secondarytransform.

FIG. 6 is a flowchart illustrating an example method of encoding videodata in accordance with the techniques of this disclosure. The method ofFIG. 6 is explained with respect to video encoder 20 and the componentsthereof as discussed with respect to FIGS. 1, 2, and 3 above, forpurposes of example and explanation. However, it should be understoodthat in other examples, other video encoding devices may perform this ora similar method consistent with the techniques of this disclosure.

Initially, video encoder 20 receives a block to be encoded (250). Inthis example, it is assumed that mode select unit 40 of video encoder 20determines to intra-predict the block (252). Although not shown in FIG.6, this decision may include predicting the block using variousprediction modes, including intra- or inter-prediction modes, andultimately determining that the block is to be intra-predicted using aparticular intra-prediction mode (e.g., an angular mode or a non-angularmode, such as DC, planar, or LM mode). Intra-prediction unit 46 of videoencoder 20 then intra-predicts the block using the intra-predictionmode, generating a predicted block.

Summer 50 then calculates a residual block (254). In particular, summer50 calculates pixel-by-pixel differences between the original block andthe predicted block to calculate the residual block, where each value(sample) of the residual block represents the corresponding pixeldifference.

Transform processing unit 52 then transforms the residual block using afirst transform (256), such as a DCT or an EMT, to produce intermediatetransform coefficients. Transform processing unit 52 also, in thisexample, applies a secondary transform, such as an NSST or a ROT, to theintermediate transform coefficients resulting from the first transform(258). In some examples, transform processing unit 52 may select thesecondary transform from a plurality of available secondary transforms.Thus, transform processing unit 52 may generate values for one or moresecondary transform syntax elements, e.g., NSST flags, NSST indexes, ROTflags, ROT indexes, EMT flags, and/or EMT indexes, and provide thesesyntax element values to entropy encoding unit 56.

Quantization unit 54 quantizes the ultimate transform coefficientsproduced by the secondary (or any subsequent) transforms, and entropyencoding unit 56 entropy encodes the quantized transform coefficients(260), as well as other syntax elements of the block (e.g., syntaxelements representative of prediction mode, partition syntax elementsrepresentative of a size of the block, or the like). In some examples,entropy encoding unit 56 also entropy encodes signaling unit syntaxelements of a signaling unit including the block. If the block is afirst block to which such signaling unit syntax elements apply, entropyencoding unit 56 may encode the signaling unit syntax elements andoutput the entropy encoded signaling unit syntax elements beforeoutputting other block-based syntax elements for the block, as discussedabove.

Entropy encoding unit 56 also entropy encodes the secondary transformsyntax as discussed above. In particular, binarizer 120 binarizes thesecondary transform syntax elements (264) in accordance with thetechniques of this disclosure. For example, binarizer 120 may perform aparticular binarization scheme, such as truncated unary binarization,regardless of a maximum possible value of the secondary transform syntaxelement.

Binarizer 120 may determine the maximum possible value of the secondarytransform syntax element based on, e.g., the intra-prediction mode usedto intra-predict the block, as discussed above. For example, if theintra-prediction mode is a non-angular mode, binarizer 120 may determinethat the maximum possible value of the secondary transform syntaxelement is 3, but if the intra-prediction mode is an angular mode,binarizer 120 may determine the maximum possible value of the secondarytransform syntax element is 4. Although this determination may be usedduring binarization, in some examples, this determination does notimpact the actual binarization scheme (e.g., truncated unarybinarization) that binarizer 120 performs to binarize the secondarytransform syntax element value.

After binarization, context modeler 122 may determine a context to beused to entropy encode the secondary transform syntax element (266). Insome examples, context modeler 122 selects the context based on themaximum possible value of the secondary transform syntax element,determined as discussed above. Regular encoding engine 124 may thenentropy encode the binarized value of the secondary transform syntaxelement using the determined context (268).

In this manner, the method of FIG. 6 represents an example of a methodof encoding video data including transforming intermediate transformcoefficients of a block of video data using a secondary transform,determining a maximum possible value for a secondary transform syntaxelement for the block, a value of the secondary transform syntax elementrepresenting the secondary transform, binarizing the value for thesecondary transform syntax element using a common binarization schemeregardless of the maximum possible value, and entropy encoding thebinarized value for the secondary transform syntax element of the blockto form a binarized value representative of the secondary transform forthe block.

FIG. 7 is a flowchart illustrating an example of a method of decodingvideo data in accordance with the techniques of this disclosure. Themethod of FIG. 7 is explained with respect to video decoder 30 and thecomponents thereof as discussed with respect to FIGS. 1, 4, and 5 above,for purposes of example and explanation. However, it should beunderstood that in other examples, other video encoding devices mayperform this or a similar method consistent with the techniques of thisdisclosure.

Initially, entropy decoding unit 70 entropy decodes predictioninformation and quantized transformation coefficients of a block ofvideo data (280). In accordance with the techniques of this disclosure,entropy decoding unit 70 also entropy decodes a secondary transformsyntax element for the block. In particular, context modeler 220determines a context to be used to entropy decode the secondarytransform syntax element (282). Context modeler 220 may determine thecontext based on a maximum possible value of the secondary transformsyntax element. For example, if the intra-prediction mode is anon-angular mode, such as DC, planar, or LM mode, context modeler 220may determine that a maximum possible value for the secondary transformsyntax element is 3, but otherwise, if the intra-prediction mode is anangular mode, context modeler 220 may determine that the maximumpossible value is 4. Context modeler 220 may then determine the contextfrom the maximum possible value of the secondary transform syntaxelement. Regular decoding engine 224 may then entropy decode data forthe secondary transform syntax element using the determined context(284).

Reverse binarizer 230 may then reverse binarize the entropy decoded datafor the secondary transform syntax element (286), to produce a value forthe secondary transform syntax element. This value may represent, forexample, whether a secondary transform is to be applied (e.g., an NSSTflag or ROT flag) and if so, which of a plurality of secondarytransforms is to be applied (e.g., an NSST index or ROT index).

Inverse quantization unit 76 may then inverse quantize the entropydecoded coefficients for the block (288). Inverse transform unit 78 mayuse the value(s) for the secondary transform syntax element(s) todetermine whether to perform a secondary transform, and if so, which ofthe plurality of secondary transforms to apply. It is assumed in FIG. 7that the secondary transform is applied. Thus, inverse transform 78initially inverse transforms the transform coefficients using thesecondary transform (290) to produce intermediate transformcoefficients, then inverse transforms the intermediate transformcoefficients using a first transform (such as a DCT or EMT) (292) toreproduce a residual block for the block.

Intra prediction unit 74 also intra-predicts the block using theindicated intra-prediction mode (294) to produce a predicted block forthe block. Summer 80 then combines the predicted block and residualblock, on a pixel by pixel basis, to produce a decoded block (296).Ultimately, video decoder 30 outputs the decoded block. Video decoder 30may also store the decoded block in reference picture memory 82, e.g.,for use in intra- or inter-predicting subsequently decoded blocks.

In this manner, the method of FIG. 7 represents an example of a methodincluding determining a maximum possible value for a secondary transformsyntax element for a block of video data, entropy decoding a value forthe secondary transform syntax element of the block to form a binarizedvalue representative of the secondary transform for the block, reversebinarizing the value for the secondary transform syntax element based onthe determined maximum possible value to determine the secondarytransform for the block, and inverse transforming transform coefficientsof the block using the determined secondary transform.

It is to be recognized that depending on the example, certain acts orevents of any of the techniques described herein can be performed in adifferent sequence, may be added, merged, or left out altogether (e.g.,not all described acts or events are necessary for the practice of thetechniques). Moreover, in certain examples, acts or events may beperformed concurrently, e.g., through multi-threaded processing,interrupt processing, or multiple processors, rather than sequentially.

In one or more examples, the functions described may be implemented inhardware, software, firmware, or any combination thereof. If implementedin software, the functions may be stored on or transmitted over as oneor more instructions or code on a computer-readable medium and executedby a hardware-based processing unit. Computer-readable media may includecomputer-readable storage media, which corresponds to a tangible mediumsuch as data storage media, or communication media including any mediumthat facilitates transfer of a computer program from one place toanother, e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transitory media, but areinstead directed to non-transitory, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablegate arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Various examples have been described. These and other examples arewithin the scope of the following claims.

What is claimed is:
 1. A method of decoding video data, the methodcomprising: decoding transform coefficients for a transform block of acurrent block of video data, the decoded transform coefficients being ina frequency domain; scanning the decoded transform coefficients to formthe transform block to include the decoded transform coefficients as atwo-dimensional matrix; determining positions of non-zero-valuedtransform coefficients of the decoded transform coefficients in thetransform block; determining a type of transform to perform according tothe positions of the nonzero-valued transform coefficients in thetransform block, the type of transform representing a transform to beapplied to the decoded transform coefficients in the transform block;transforming the decoded transform coefficients in the transform blockusing the type of transform to produce a residual block, the residualblock including residual samples in a spatial domain; and decoding thecurrent block using the residual block.
 2. The method of claim 1,wherein determining the type of transform comprises determining the typeof transform without decoding a value for a syntax element of the videodata indicating the type of transform.
 3. The method of claim 1, whereindetermining the type of transform comprises: determining a number of thenon-zero-valued transform coefficients following an Nth transformcoefficient in the transform block in scan order, wherein N is aninteger value; and determining the type of transform according to thenumber of non-zero-valued transform coefficients following the Nthtransform coefficient in scan order.
 4. The method of claim 3, furthercomprising determining a value of N as a predefined value.
 5. The methodof claim 3, wherein determining the type of transform comprisesdetermining that the type of transform is a non-separable transform whenthe number of non-zero-valued transform coefficients following the Nthtransform coefficient is zero.
 6. The method of claim 3, whereindetermining the type of transform comprises: when the number of thenon-zero-valued transform coefficients following the Nth transformcoefficient is greater than zero: decoding a value for a syntax elementindicating the type of transform coefficient; and determining the typeof transform coefficient according to the value of the syntax element;and when the number of the non-zero-valued transform coefficientsfollowing the Nth transform coefficient is equal to zero, determiningthe type of transform without decoding the value for the syntax element.7. The method of claim 1, wherein decoding the transform coefficientscomprises: determining a context model for entropy decoding a value ofone of the transform coefficients according to a value of a syntaxelement corresponding to the type of transform; and entropy decoding thevalue of the one of the transform coefficients using the context model.8. The method of claim 1, wherein decoding the current block comprises:forming a prediction block for the current block; and combining samplesof the prediction block with samples of the residual block.
 9. Themethod of claim 1, further comprising encoding the current block priorto decoding the current block.
 10. The method of claim 1, whereintransforming the decoded transform coefficients comprises applying asecondary transform of the type of transform to the decoded transformcoefficients.
 11. A device for decoding video data, the devicecomprising: a memory configured to store video data; and one or moreprocessors implemented in circuitry and configured to: decode transformcoefficients for a transform block of a current block of video data, thedecoded transform coefficients being in a frequency domain; scan thedecoded transform coefficients to form the transform block to includethe decoded transform coefficients as a two-dimensional matrix;determine positions of non-zero-valued transform coefficients of thedecoded transform coefficients in the transform block; determine a typeof transform to perform according to the positions of thenon-zero-valued transform coefficients in the transform block, the typeof transform representing a transform to be applied to the decodedtransform coefficients in the transform block; transform the decodedtransform coefficients in the transform block using the type oftransform to produce a residual block, the residual block includingresidual samples in a spatial domain; and decode the current block usingthe residual block.
 12. The device of claim 11, wherein the one or moreprocessors are configured to determine the type of transform withoutdecoding a value for a syntax element of the video data indicating thetype of transform.
 13. The device of claim 11, wherein to determine thetype of transform, the one or more processors are configured to:determine a number of the non-zero-valued transform coefficientsfollowing an Nth transform coefficient in the transform block in scanorder, wherein N is an integer value; and determine the type oftransform according to the number of non-zero-valued transformcoefficients following the Nth transform coefficient in scan order. 14.The device of claim 13, whereon the one or more processors are furtherconfigured to determine a value of N as a predefined value.
 15. Thedevice of claim 13, wherein the one or more processors are configured todetermine that the type of transform is a non-separable transform whenthe number of non-zero-valued transform coefficients following the Nthtransform coefficient is zero.
 16. The device of claim 13, wherein todetermine the type of transform, the one or more processors areconfigured to: when the number of the non-zero-valued transformcoefficients following the Nth transform coefficient is greater thanzero: decode a value for a syntax element indicating the type oftransform coefficient; and determine the type of transform coefficientaccording to the value of the syntax element; and when the number of thenon-zero-valued transform coefficients following the Nth transformcoefficient is equal to zero, determine the type of transform withoutdecoding the value for the syntax element.
 17. The device of claim 11,wherein to decode the current block, the one or more processors areconfigured to: form a prediction block for the current block; andcombine samples of the prediction block with samples of the residualblock.
 18. The device of claim 11, wherein the one or more processorsare further configured to encode the current block prior to decoding thecurrent block.
 19. The device of claim 11, further comprising a displayconfigured to display the decoded video data.
 20. The device of claim11, wherein the device comprises one or more of a camera, a computer, amobile device, a broadcast receiver device, or a set-top box.
 21. Thedevice of claim 11, wherein the one or more processors are configured toapply a secondary transform of the type of transform to the decodedtransform coefficients.
 22. A device for decoding video data, the devicecomprising: means for decoding transform coefficients for a transformblock of a current block of video data, the decoded transformcoefficients being in a frequency domain; means for scanning the decodedtransform coefficients to form the transform block to include thedecoded transform coefficients as a two-dimensional matrix; means fordetermining positions of non-zero-valued transform coefficients of thedecoded transform coefficients in the transform block; means fordetermining a type of transform to perform according to the positions ofthe non-zero-valued transform coefficients in the transform block, thetype of transform representing a transform to be applied to the decodedtransform coefficients in the transform block; means for transformingthe decoded transform coefficients in the transform block using the typeof transform to produce a residual block, the residual block includingresidual samples in a spatial domain; and means for decoding the currentblock using the residual block.
 23. The device of claim 22, wherein themeans for determining the type of transform comprises means fordetermining the type of transform without decoding a value for a syntaxelement of the video data indicating the type of transform.
 24. Thedevice of claim 22, wherein the means for determining the type oftransform comprises: means for determining a number of thenon-zero-valued transform coefficients following an Nth transformcoefficient in the transform block in scan order, wherein N is aninteger value; and means for determining the type of transform accordingto the number of nonzero-valued transform coefficients following the Nthtransform coefficient in scan order.
 25. The device of claim 22, whereinthe means for transforming the decoded transform coefficients comprisesmeans for applying a secondary transform of the type of transform to thedecoded transform coefficients.
 26. A computer-readable storage mediumhaving stored thereon instructions that, when executed, cause aprocessor of a device for decoding video data to: decode transformcoefficients for a transform block of a current block of video data, thedecoded transform coefficients being in a frequency domain; scan thedecoded transform coefficients to form the transform block to includethe decoded transform coefficients as a two-dimensional matrix;determine positions of non-zero-valued transform coefficients of thedecoded transform coefficients in the transform block; determine a typeof transform to perform according to the positions of the nonzero-valuedtransform coefficients in the transform block, the type of transformrepresenting a transform to be applied to the decoded transformcoefficients in the transform block; transform the decoded transformcoefficients in the transform block using the type of transform toproduce a residual block, the residual block including residual samplesin a spatial domain; and decode the current block using the residualblock.